_Pragma("once")

#include "libmath.hpp"

namespace sdl_engine::component::graphics {

class Bresenham {
public:
    Bresenham(const Point& p1, const Point& p2);

    inline const Point& CurPoint() const { return p1_; }

    inline bool IsFinished() const { return p1_ == p2_; }

    void Step();

private:
    Point p1_;
    Point p2_;
    int dx_;
    int dy_;
    int sx_;
    int sy_;
    int err_;
};

}
